
package CelestialDataStructures;

import java.util.List;

public abstract class ForEachListDelegate<T> {

     public final void doForEach(List<T> lst){

        beforeForEach();
        
        for(T item: lst) forEach(item);

        afterForEach();
    }
    /************************************************************************/
    /* abstract methods */
    protected abstract void beforeForEach();
    protected abstract void afterForEach();
    protected abstract void forEach(T item);
}
